package pl.druminski.robinhood.controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import pl.druminski.robinhood.model.Data;
import pl.druminski.robinhood.view.Gui;

/**
 * @author Łukasz Drumiński
 * 
 */
public class ALDeleteProxy implements ActionListener
{
    private Data data;
    private Gui gui;

    public ALDeleteProxy(Data data, Gui gui)
    {
        this.data = data;
        this.gui = gui;
    }
    public void actionPerformed(ActionEvent e)
    {
        int row = gui.tblProxy.getSelectedRow();

        if (row > -1)
        {
            data.proxyList.remove(row);
            gui.proxyModel.fireTableRowsDeleted(0, data.proxyList.size());
        }
    }

}
